﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using Dqaqs.Data;

namespace Dqaqs.Services.ServiceContracts
{
	[ServiceContract]
	public interface IProjectService
	{
		/// <summary>
		/// News the project.
		/// </summary>
		/// <param name="project">The project.</param>
		[OperationContract]
		void NewProject(Project project);

		/// <summary>
		/// Gets the project.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <returns></returns>
		[OperationContract]
		Project GetProject(Guid id);

		/// <summary>
		/// Deletes the project.
		/// </summary>
		/// <param name="id">The id.</param>
		[OperationContract]
		void DeleteProject(Guid id);

		/// <summary>
		/// Lists the projects.
		/// </summary>
		/// <returns></returns>
		[OperationContract]
		IEnumerable<Project> ListProjects();

		/// <summary>
		/// Updates the project.
		/// </summary>
		/// <param name="project">The project.</param>
		[OperationContract]
		void UpdateProject(Project project);

		/// <summary>
		/// Checks the project exists.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <param name="title">The title.</param>
		/// <returns></returns>
		[OperationContract]
		bool CheckProjectExists(Guid id, string title);

		/// <summary>
		/// Validates the schema.
		/// </summary>
		/// <param name="schema">The schema.</param>
		/// <returns>Error message if there is an error or an empty string otherwise</returns>
		[OperationContract]
		string ValidateSchema(string schema);

		/// <summary>
		/// Processes the schema.
		/// </summary>
		/// <param name="schema">The schema.</param>
		/// <returns>The processed schema as XML</returns>
		[OperationContract]
		string ProcessSchema(string schema);
	}
}
